import React, { useState } from "react";
import instance from "../api/request";

function useRequest(url, params) {
  const [list, setList] = useState([]);
  instance.get(url, { params }).then((res) => {
    setList(res);
  });
  return list;
}

export default useRequest;
